-
Notifications
You must be signed in to change notification settings - Fork 145
chore: rename check_advanced_requirement.sh to bot-advanced-check.sh #1341 #1353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: rename check_advanced_requirement.sh to bot-advanced-check.sh #1341 #1353
Conversation
…iero-ledger#1341 Signed-off-by: akram sdm <[email protected]>
Signed-off-by: akram sdm <[email protected]>
|
Hi, this is WorkflowBot.
|
📝 WalkthroughWalkthroughAdds a new GitHub Actions helper script Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Actions as GitHub Actions
participant Script as bot-advanced-check.sh
participant API as GitHub REST API
Note over Actions,Script: Workflow runs verification step
Actions->>Script: run bot-advanced-check.sh (env: REPO, ISSUE_NUMBER, GH_TOKEN, TRIGGER_ASSIGNEE?)
Script->>API: GET /repos/:owner/:repo/issues/:issue_number (fetch assignees)
API-->>Script: assignees list
alt TRIGGER_ASSIGNEE set
Script->>API: GET /search/issues?q=assignee:TRIGGER_ASSIGNEE+label:"Good First Issue"
API-->>Script: countA
Script->>API: GET /search/issues?q=assignee:TRIGGER_ASSIGNEE+label:intermediate
API-->>Script: countB
else iterate assignees
loop per assignee
Script->>API: GET /search/issues?q=assignee:<user>+label:"Good First Issue"
API-->>Script: countA
Script->>API: GET /search/issues?q=assignee:<user>+label:intermediate
API-->>Script: countB
end
end
alt counts meet threshold OR user is core member
Script-->>Actions: no action (qualified)
else not qualified
Script->>API: POST /repos/:owner/:repo/issues/:issue_number/comments (tailored message)
API-->>Script: comment created
Script->>API: DELETE /repos/:owner/:repo/issues/:issue_number/assignees (unassign user)
API-->>Script: unassign confirmed
end
Note over Script,API: script logs actions and handles errors / numeric parsing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
.github/scripts/bot-advanced-check.sh.github/workflows/bot-advanced-check.ymlCHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (2)
.github/workflows/**/*
⚙️ CodeRabbit configuration file
.github/workflows/**/*: Review workflows as security-sensitive infrastructure.A good workflow is small, focused, and boring.
If a workflow is clever, generic, or overly flexible, it is a risk.
PRIORITY 0 — ABSOLUTE REQUIREMENTS
- All third-party actions MUST be pinned to full commit SHAs, similar to other workflows.
permissions:MUST be explicitly declared and minimally scoped.- Workflows MUST behave safely when executed from forks.
- YAML MUST orchestrate steps, not implement business logic.
- Any workflow that mutates GitHub state MUST support dry-run mode.
- Dry-run behavior must be explicit and visible in logs.
- Workflows MUST NOT modify repository source code outside
.github/.
PRIORITY 1 — SCOPE, FOCUS & RESTRAINT
- The title of each workflow must be relevant, match similar naming schemes, and match its script filename.
- Each workflow MUST have a single, clearly defined objective and SHOULD document this in a top-level comment.
- Flag workflows that:
- Attempt to be generic “frameworks”
- Include speculative or future-facing logic
- Perform actions unrelated to the stated goal
- Over-abstraction and excess flexibility are maintenance risks.
PRIORITY 2 — INPUT HARDENING
- Treat ALL GitHub event data as potentially hostile input, including:
- issue titles, bodies, and comments
- labels, usernames, branch names
- Free-form user input MUST NOT be passed directly into:
- shell commands
- gh CLI arguments
- Node.js exec / spawn calls
- Require strict allowlists or exact string matches.
- Flag any use of:
- eval or bash -c
- backticks or $(...) with user-controlled input
------------------...
Files:
.github/workflows/bot-advanced-check.yml
.github/scripts/**/*.sh
⚙️ CodeRabbit configuration file
.github/scripts/**/*.sh: Treat shell scripts as production-grade automation.Scripts should be small, focused, and explicit.
Avoid “do-everything” or overly generic scripts.
- MUST use:
set -euo pipefail- MUST validate all required environment variables
- MUST defensively quote variables
- MUST validate all untrusted input
- MUST have bounded loops and pagination
- MUST support dry-run mode if state is mutated
- MUST log key decisions and early exits
Files:
.github/scripts/bot-advanced-check.sh
🧬 Code graph analysis (1)
.github/scripts/bot-advanced-check.sh (1)
.github/scripts/linked_issue_enforce.js (1)
assignees(14-14)
🪛 LanguageTool
CHANGELOG.md
[uncategorized] ~717-~717: The official name of this software platform is spelled with a capital “H”.
Context: ...### Removed - N/A ### Changed - Renamed .github/scripts/check_advanced_requirement.sh ...
(GITHUB)
🪛 markdownlint-cli2 (0.18.1)
CHANGELOG.md
716-716: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above
(MD022, blanks-around-headings)
716-716: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
716-716: Multiple headings with the same content
(MD024, no-duplicate-heading)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (3)
.github/workflows/bot-advanced-check.yml (1)
37-38: Script reference updated correctly.The workflow now correctly references the renamed script
bot-advanced-check.sh, maintaining consistency between the workflow filename and its primary script. The workflow follows best practices with pinned action SHA, minimal permissions, and concurrency control..github/scripts/bot-advanced-check.sh (2)
1-13: Good defensive setup with proper shell options and env validation.The script correctly uses
set -euo pipefailand validates all required environment variables upfront. The log helper provides consistent output formatting.
73-93: Main logic handles both trigger modes correctly.The script properly handles the single-assignee trigger case (
TRIGGER_ASSIGNEE) and falls back to checking all current assignees. The use of a here-string (<<<) for iteration is a good practice that avoids subshell variable scope issues.
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
Status, support, documentation and community
|
…iero-ledger#1341 Signed-off-by: akram sdm <[email protected]>
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! final step now please!
Signed-off-by: akram sdm <[email protected]>
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. To assist you, please read: Thank you for contributing! |
Signed-off-by: akram sdm <[email protected]>
tech0priyanshu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for contribution @akramsdm
AntonioCeppellini
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @akramsdm, thanks for your contribution! Good job :D
|
Hi @akramsdm this is approved thank you all |
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve the merge conflict 👍
aceppaluni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akramsdm This is great work 👍
Please let us know if you need assistance with the merge conflict.
Thank you so much for your contribution!!
|
Thank you so much, @aceppaluni. |
Signed-off-by: akram sdm <[email protected]>
|
Hi @akramsdm yes! they can be tricky |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1353 +/- ##
=======================================
Coverage 92.44% 92.44%
=======================================
Files 139 139
Lines 8528 8528
=======================================
Hits 7884 7884
Misses 644 644 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
CHANGELOG.md
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md
[uncategorized] ~94-~94: The official name of this software platform is spelled with a capital “H”.
Context: ...pam list updates. ### Changed - Renamed .github/scripts/check_advanced_requirement.sh ...
(GITHUB)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: build-and-test (3.10)
- GitHub Check: build-and-test (3.13)
- GitHub Check: build-and-test (3.11)
- GitHub Check: build-and-test (3.12)
- GitHub Check: run-examples
- GitHub Check: Codacy Static Code Analysis
|
@exploreriii thanks, |
|
You're very welcome, if you want to try something similar but slightly more challenging, we have a few beginner issues available: |
Description:
Rename the advanced issue guard script to align with the workflow naming
and improve maintainability as the number of GitHub workflows grows.
.github/scripts/check_advanced_requirement.shtobot-advanced-check.sh.github/workflows/bot-advanced-check.ymlto reference the new script nameRelated issue(s):
Fixes #1341
Notes for reviewer:
This change is a rename only and introduces no functional behavior changes.
Existing CI workflows validate the update.